﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Trade.Controls
{
    public class ComboPopup : Form
    {
        public ComboPopup()
        {
            InitializeComponent();
        }

        private void InitializeComponent()
        {
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(164, 106);
            this.ControlBox = false;
            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
            this.BackColor = System.Drawing.SystemColors.Control;
            this.KeyPreview = true;
            this.Name = "ComboPopup";
            this.ShowInTaskbar = false;
            this.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
            this.Text = "ComboPopup";
            this.Deactivate += new System.EventHandler(this.ComboPopup_Deactivate);
            this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.ComboPopup_KeyDown);
            this.Leave += new System.EventHandler(this.ComboPopup_Leave);
            this.ResumeLayout(false);
        }

        private void ComboPopup_Deactivate(object sender, EventArgs e)
        {
            this.Close();
        }

        private void ComboPopup_Leave(object sender, EventArgs e)
        {
            this.Close();
        }

        private void ComboPopup_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyData == Keys.Escape)
            {
                this.Close();
            }
        }
    }
}
